package com.shen.pojo.aircraft;

/**
 * Author:shen
 * CreateDate:2020/5/13.
 * Function:飞行员
 */
public class Pilot {
    public void driving(Object object){
        if(object instanceof Jet){
            System.out.println("飞行员驾驶客机");
           ((Jet) object).start();
           ((Jet) object).speedUp();
           ((Jet) object).stop();
        }else if(object instanceof Fighter){
            System.out.println("飞行员驾驶战斗机");
            ((Fighter) object).start();
            ((Fighter) object).speedUp();
            ((Fighter) object).launch();
            ((Fighter) object).hover();
            ((Fighter) object).stop();
        }
    }
}
